package com.sjx.boundarycallback;

import android.app.Application;

import com.google.gson.Gson;
import com.sjx.sjxlibrary.log.HiConsolePrinter;
import com.sjx.sjxlibrary.log.HiLogConfig;
import com.sjx.sjxlibrary.log.HiLogManager;

/**
 * Created by sjx on 6/17/22
 * Application类，程序的入口
 */
public class BoundaryApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        HiLogManager.init(new HiLogConfig() {
            @Override
            public String getGlobalTag() {
                return "BoundaryApplication";
            }

            @Override
            public boolean enable() {
                return true;
            }

            @Override
            public JsonParser injectJsonParser() {
                return src -> new Gson().toJson(src);
            }

            @Override
            public boolean includeThread() {
                return true;
            }

            @Override
            public int stackTraceDepth() {
                return 5;
            }



        });

        HiLogManager.getInstance().addPrinter(new HiConsolePrinter());

    }
}
